import 'package:json_annotation/json_annotation.dart';
import 'package:sticky_and_expandable_list/sticky_and_expandable_list.dart';

part 'tbSectionModel.g.dart';

@JsonSerializable()
class TbSectionModel extends ExpandableListSection {
  TbSectionModel();

  String? header;
  List? items;
  bool? expanded;

  factory TbSectionModel.fromJson(Map<String, dynamic> json) =>
      _$TbSectionModelFromJson(json);
  Map<String, dynamic> toJson() => _$TbSectionModelToJson(this);

  @override
  List? getItems() {
    return items;
  }

  @override
  bool isSectionExpanded() {
    return this.expanded ?? true;
  }

  @override
  void setSectionExpanded(bool expanded) {
    this.expanded = expanded;
  }
}
